﻿using System.Collections.Generic;
using System.Linq;
using CkSoftware.GroupMe.Sdk.Core.Dao;

namespace CkSoftware.GroupMe.Sdk.Messaging.Dao
{
	/// <summary>
	/// The state of a message load.
	/// </summary>
	public class LoadMessagesResultData
	{
		/// <summary>
		/// Instantiates a new <see cref="LoadMessagesResultData" /> object.
		/// </summary>
		public LoadMessagesResultData()
		{
			Messages = Enumerable.Empty<GroupMeMessageData>();
		}

		/// <summary>
		/// The list of loaded messages.
		/// </summary>
		public IEnumerable<GroupMeMessageData> Messages { get; set; }

		/// <summary>
		/// The total avaliable number of messages.
		/// </summary>
		public long MessagesCount { get; set; }

		/// <summary>
		/// Defines if a gap was detected between now and the previous message loading. If this should be true, it is recommendet to do a complete message-cache refresh, as there were unloaded messages which cannot be loaded again.
		/// </summary>
		public bool MessagesGapDetected { get; set; }
	}
}